﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Streambolics.Tablet
{
    public class CommonTouchTracker : ITouchTracker
    {
        private int _LastX;
        private int _LastY;

        #region ITouchTracker Members

        public virtual void Down (WMTouchEventArgs e)
        {
            RememberLastPosition (e);
        }

        public virtual void Move (WMTouchEventArgs e)
        {
            RememberLastPosition (e);
        }

        public virtual void Up (WMTouchEventArgs e)
        {
            RememberLastPosition (e);
        }

        #endregion

        public int LastX
        {
            get
            {
                return _LastX;
            }
        }

        public int LastY
        {
            get
            {
                return _LastY;
            }
        }

        private void RememberLastPosition (WMTouchEventArgs e)
        {
            _LastX = e.LocationX;
            _LastY = e.LocationY;
            // TODO : call OnLocationChanged ?
        }


    }
}
